<template>
	<div class="book-sort-page">
		<h2>图书分类：{{ sort }}</h2>
		<BookList :books="books" if_no="暂无图书"></BookList>
	</div>
</template>

<script>
	import BookList from '../components/BookList.vue'
	export default {
		data() {
			return {
				baseURL: 'http://111.229.37.167/',
				books: [],
				sort: this.$route.query.sort
			}
		},
		created() {
			document.title = this.sort;
			this.axios.get('/book/category/'+this.$route.params.id+'/page',
			{params: {
				pageNum: 1,
				pageSize: 100
			}})
			.then((response) => {
				if(response.data.code == '200') {
					this.books = response.data.data;
				}else{
					console.log(response.status);
				}
			})
			.catch((err) => {
				console.log(err);
			})
		},
		components: {
			BookList
		}
	}
</script>

<style lang="less">
	.book-sort-page {
		text-align: center;
	}
	
	
	
</style>
